<!--这个组件没有写完，不可用-->
<template>
    <div>
        <span @click="innerValue ++">+</span>
        <!--                v-on:change="$emit('change', $event.target.value)"
-->
        <input

                class="my-model-input"
                type="number"
                v-bind:value="innerValue"
        >
        <span @click="innerValue --">-</span>
    </div>
</template>

<script>
    export default {
        name: "InputNumber",
        props: ['value'],
        data(){
            return{
                innerValue:''
            }
        },
        created(){
            this.innerValue = this.value
        },
        methods:{
        },
        watch:{
            value(val){
                this.innerValue = val;
            },
            innerValue(val){
                this.$emit('change',val);
                console.log(this.$parent)
            }
        }

    }
</script>

<style scoped>

</style>